import React, { Component } from 'react';
import { View } from 'react-native';
import { px2dp } from 'bee/utils';
import BeneInfo from './BeneInfo';

// @flow
type Props = {
  data: Array,
  changeInfo: Function,
};

class Benes extends Component<Props> {
  render() {
    const { data, changeInfo } = this.props;
    return (
      <View>
        {data.map((info, index) => (
          <View style={{ borderBottomWidth: px2dp(4) }} key={index}>
            <BeneInfo
              info={info}
              changeInfo={changeInfo}
              id={index}
              data={data}
            />
          </View>
        ))}
      </View>
    );
  }
}

export default Benes;
